<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" indent="yes"/>

  <xsl:template match="/">
    <html>
      <head><title>Files</title></head>
      <body>
        <xsl:value-of select="files/@scan_date"/>
        <xsl:text> </xsl:text>
        <a href="{files/@scan_dir_url}"><xsl:value-of select="files/@scan_dir_decoded_url"/></a>
	<table border="1">
	  <tr bgcolor="#00CC33">
	    <th align="left">Name</th>
            <th align="left">Dir</th>
	    <th align="left">Size</th>
	    <th align="left">Date</th>	      
	  </tr>
	  <xsl:for-each select="files/file">
	  <xsl:sort select="@name" order="ascending"/>
	  <tr>
	    <td>
              <a href="{@url}"><xsl:value-of select="@name"/></a>
            </td>
            <td align="center">
              <a href="{@dir_url}">~</a>
            </td>
	    <td align="right">
              <xsl:value-of select="@size"/></td>
	    <td>
              <xsl:value-of select="@date"/>
            </td>
	  </tr>
	  </xsl:for-each>
	</table>
      </body>
    </html>
  </xsl:template>

</xsl:stylesheet>
